#ifndef __losor_xml_h__
#define __losor_xml_h__

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _field
{
    char *name;
    char *val;
} field;

typedef struct _xml
{
    char *name;
    field **attr;
    struct _xml **child;
    struct _xml *parent;
    struct _xml *brother;
} xml;

xml* xml_parse( const char* file );
void xml_destroy( xml *x );
const char* xml_attr( xml *x, const char *attr );
xml* xml_find( xml *x, const char *name );
xml* xml_brother( xml *x );
xml* xml_parent( xml *x );

#ifdef __cplusplus
};
#endif

#endif // __losor_xml_h__
